package chixing.day15;
import java.util.Date;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.Month;

/**
 * M month
 * m minute
 * h 0-12hour
 * H 0-24hour
 * s second
 * S mill second
 * 年月日 yyyy-MM-dd
 *年月日时分秒 yyyy-MM-dd HH:mm:ss
 * 年月日时分秒毫秒 yyyy-MM-dd HH:mm:ss.SSS
 */
public class DateDemo {
    private LocalDate date;
    private LocalDateTime time;
    private LocalTime time2;
    private Date date2;
    public static void main(String[] args) {
        LocalDate date1 = LocalDate.now();
        LocalDateTime date2 = LocalDateTime.now();
        LocalTime date3 = LocalTime.now();
        System.out.println("LocalDate.now() :" + date1 );
        System.out.println("LocalDateTime.now() :" + date2 );
        System.out.println("LocalTime.now() :" + date3 );

        LocalDate date4 = LocalDate.of(2020, 4, 1);
        System.out.println("LocalDate.of() dat4 = " + date4 );
        int year = date4.getYear();
        Month month = date4.getMonth();
        int monthValue = date4.getMonth().getValue();
        int dayOfMonth = date4.getDayOfMonth();

        System.out.println(year);
        System.out.println(month);
        System.out.println(monthValue);
        System.out.println(dayOfMonth);

        Date date111 = new Date();  // Fri Aug 08 11:37:53 CST 2025
        System.out.println(date111);
    }

}
